package com.qf.news.controller;

import com.qf.news.entity.NewsType;
import com.qf.news.service.NewsTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 新闻分类(NewsType)表控制层
 *
 * @author makejava
 * @since 2023-10-20 16:03:11
 */
@RestController
@RequestMapping("newsType")
@CrossOrigin
public class NewsTypeController {
    /**
     * 服务对象
     */
    @Autowired
    private NewsTypeService newsTypeService;

    /**
     * 查询所有的新闻列表
     * @return
     */
    @GetMapping("/list")
    public List<NewsType> list(){
        System.out.println("查询所有新闻分类！！");
        return newsTypeService.list();
    }

}

